<template>
  <div>
    <a @click="one" href="http://www.baidu.com">去百度</a>
    <hr />
    <a @click="two(10, $event)" href="http://www.taobao.com">去淘宝</a>
    <p>sun的值为:{{ sum }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sum: 1,
    };
  },
  methods: {
    one(e) {
      e.preventDefault();
    },
    two(sun, e) {
      this.sum += sun;
      e.preventDefault();
    },
  },
};
</script>

<style>
</style>